package com.sourceQ.common.core.constant;

import com.sourceQ.common.core.exception.ErrorCode;

/**
 * @author: SourceQ
 * @create: 2024-03-28 15:05
 * @Description: 系统错误码
 */
public interface ErrorCodeConstants {
    // ========== 通用错误码 =========
    ErrorCode PARAMETER_ERROR = new ErrorCode(HttpStatus.BAD_REQUEST,"【{}】参数错误");
    // ========== 租户套餐  ==========
    ErrorCode TENANT_PACKAGE_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "租户套餐不存在");
    ErrorCode TENANT_PACKAGE_USED = new ErrorCode(HttpStatus.RESOURCE_USING, "租户正在使用该套餐，请给租户重新设置套餐后再尝试删除");
    ErrorCode TENANT_PACKAGE_DISABLE = new ErrorCode(HttpStatus.RESOURCE_BAN, "名字为【{}】的租户套餐已被禁用");

    // ========== 租户信息  ==========
    ErrorCode TENANT_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "租户不存在");
    ErrorCode TENANT_DISABLE = new ErrorCode(HttpStatus.RESOURCE_BAN, "名字为【{}】的租户已被禁用");
    ErrorCode TENANT_EXPIRE = new ErrorCode(HttpStatus.TENANT_RESOURCE_EXPIRE, "名字为【{}】的租户已过期");
    ErrorCode TENANT_UN_EXPIRE = new ErrorCode(HttpStatus.TENANT_RESOURCE_UN_EXPIRE, "名字为【{}】的租户未过期,不能删除！");

    ErrorCode TENANT_CAN_NOT_UPDATE_SYSTEM = new ErrorCode(HttpStatus.OPERATE_BAN, "系统租户不能进行修改、删除等操作！");
    ErrorCode TENANT_NAME_DUPLICATE = new ErrorCode(HttpStatus.RESOURCE_EXISTS, "名字为【{}】的租户已存在");
    ErrorCode TENANT_WEBSITE_DUPLICATE = new ErrorCode(HttpStatus.RESOURCE_EXISTS, "域名为【{}】的租户已存在");

    // ========== 邮件信息  ==========
    ErrorCode MAIL_TEMPLATE_CODE_EXISTS = new ErrorCode(HttpStatus.RESOURCE_EXISTS,"邮件模版 code({}) 已存在");
    ErrorCode MAIL_TEMPLATE_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND,"邮件模版不存在");

    ErrorCode MAIL_ACCOUNT_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND,"邮箱账号不存在");
    ErrorCode MAIL_ACCOUNT_RELATE_TEMPLATE_EXISTS = new ErrorCode(HttpStatus.OPERATE_BAN,"无法删除，该邮箱账号还有邮件模板");

    ErrorCode MAIL_SEND_MAIL_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND,"邮箱不存在");
    ErrorCode MAIL_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(HttpStatus.BAD_REQUEST, "模板参数({})缺失");
    // ========== 短信信息  ==========
    ErrorCode SMS_CHANNEL_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "短信渠道不存在");
    ErrorCode SMS_CHANNEL_HAS_CHILDREN = new ErrorCode(HttpStatus.OPERATE_BAN, "无法删除，该短信渠道还有短信模板");
    ErrorCode SMS_CHANNEL_DISABLE = new ErrorCode(HttpStatus.RESOURCE_NOT_START, "短信渠道不处于开启状态，不允许选择");

    ErrorCode SMS_TEMPLATE_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "短信模板不存在");
    ErrorCode SMS_TEMPLATE_CODE_DUPLICATE = new ErrorCode(HttpStatus.RESOURCE_EXISTS, "已经存在编码为【{}】的短信模板");
    ErrorCode SMS_TEMPLATE_API_ERROR = new ErrorCode(HttpStatus.CALL_FAILED, "短信 API 模板调用失败，原因是：{}");
    ErrorCode SMS_TEMPLATE_API_AUDIT_CHECKING = new ErrorCode(HttpStatus.RESOURCE_NOT_START, "短信 API 模版无法使用，原因：审批中");
    ErrorCode SMS_TEMPLATE_API_AUDIT_FAIL = new ErrorCode(HttpStatus.RESOURCE_NOT_START, "短信 API 模版无法使用，原因：审批不通过，{}");
    ErrorCode SMS_TEMPLATE_API_NOT_FOUND = new ErrorCode(HttpStatus.RESOURCE_NOT_START, "短信 API 模版无法使用，原因：模版不存在");

    ErrorCode SMS_SEND_TEMPLATE_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "短信模板不存在");
    ErrorCode SMS_SEND_MOBILE_NOT_EXISTS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "手机号不存在");
    ErrorCode SMS_SEND_MOBILE_TEMPLATE_PARAM_MISS = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "模板参数({})缺失");

    ErrorCode SMS_CODE_SEND_TOO_FAST = new ErrorCode(HttpStatus.CALL_FREQUENTLY, "短信发送过于频繁");
    ErrorCode SMS_CODE_UNEXPIRED = new ErrorCode(HttpStatus.RESOURCE_UNEXPIRED, "短信还未过期，还可以继续使用");
    ErrorCode SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY = new ErrorCode(HttpStatus.CALL_EXCEEDED_TIMES, "超过每日短信发送数量");
    ErrorCode SMS_CODE_NOT_FOUND = new ErrorCode(HttpStatus.RESOURCE_NOT_FOUND, "验证码不存在");
    ErrorCode SMS_CODE_EXPIRED = new ErrorCode(HttpStatus.RESOURCE_EXPIRED, "验证码已过期");
    ErrorCode SMS_CODE_USED = new ErrorCode(HttpStatus.RESOURCE_USED, "验证码已使用");
}
